#include "Headers/GPIO.h"
#include "Headers/define.h"
#include "Headers/SPI.h"
#include "Headers/time.h"
#include "Headers/RF.h"
void ledandpush_configuration(void){
  /* leds and switch configuration */
  GPIO_config('D',cuatro,output,on);
  GPIO_config('D',cinco,output,on);
  GPIO_config('D',seis,output,on);
  GPIO_config('D',siete,output,on);
  
  GPIO_config('A',dos,input,on);
  GPIO_config('A',tres,input,on);
  GPIO_config('A',cuatro,input,on);
  GPIO_config('A',cinco,input,on);
  /*********************************/
  
  GPIO_config('C',dos,input,on);//data
  GPIO_config('C',tres,input,on);//clock
}
void modem_config(void){
  /**** ZigBee modem configuracions **********************/
  SPI_init(off); /* the parameter is for bidirectional mode refer to the datasheet */
  delay_ms(25);
  SendCommand(PSM_Mode, 0xA0C0);
  SendCommand(Reserved, 0xFEC6);
  SendCommand(PA_Lvl, 0x00FC); //Power adjustment output
  
  delay_ms(10);
  version = ReadCommand(Chip_Id);
  control_a = ReadCommand(Control_A);
  control_b = ReadCommand(Control_B);
  control_c = ReadCommand(Control_C);
  delay_ms(1);
  Set_up_pkt(15);//Acording to the protocol ZigBee Fc = 2405 + 5*(K-11), where 11 >= k <= 26
  /***************************************************/
}